package main

import "fmt"

type animal struct {
	name string
}

func (a animal) run() {
	fmt.Printf("%v 在运动\n", a.name)
}

type dog struct {
	age int
	animal
}

func (d dog) wang() {
	fmt.Printf("%v %v 岁了\n", d.name, d.age)
}
func main() {
	var d dog
	d.name = "豆豆"
	d.age = 6
	fmt.Printf("%#v\n", d)
	d.run()
	d.wang()
}
